package org.leon.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/4/18.
 */
@Controller
public class DataBindingTest {

    private static final Log logger = LogFactory.getLog(DataBindingTest.class);

    @RequestMapping(value = "/pathVariableTest/{userid}")
    public void pathVariableTest(@PathVariable Integer userid){
        logger.info(userid);
    }

    @RequestMapping(value = "/initTest")
    public String initTest(){

        return "datatBindingTest";
    }

    @RequestMapping(value = "/cookieValueTest")
    @ResponseBody()
    public void cookieValueTest(@CookieValue(value="JSESSIONID", defaultValue = "") String sessionId){
        logger.info("sessionId: "+sessionId);
    }


}
